<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'accountCity.label', default: 'AccountCity')}"/>
    <title>机构：${this.account.name}</title>
    <style>
    .checkboxGroup {
        display: inline-block;
        padding: 7px 10px;
    }
    </style>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>机构管理</span>
                    </li>
                </ol>
            </div>
            <h2 class="font-light m-b-xs">
                开通城市
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">

    <div class="row">
        <g:if test="${flash.message}">
            <div class="message alert alert-info" role="status">${flash.message}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
            </div>
        </g:if>
        <div class="hpanel hred contact-panel">
            <div class="panel-heading">
                <div class="panel-tools">
                    <!-- <g:link class="btn btn-info btn-xs" action="edit" resource="${this.account}"><i class="fa fa-edit"></i>编辑</g:link> -->
                </div>
                机构基本信息
            </div>

            <div class="panel-body">
                <div class="text-muted font-bold m-b-xs ol-md-6">
                    <div class="col-md-12"><h4>${this.account?.name}</h4></div>
                </div>
            </div>

            <div class="panel-footer contact-footer">
                <div class="row">
                    <div class="col-md-3 border-right" style="">
                        <div class="contact-stat"><span>机构联系人</span> <strong>${this.account?.contact}</strong>
                        </div>
                    </div>

                    <div class="col-md-3 border-right" style="">
                        <div class="contact-stat"><span>机构电话</span> <strong>${this.account?.phone}</strong>
                        </div>
                    </div>

                    <div class="col-md-3 border-right" style="">
                        <div class="contact-stat"><span>所在城市</span> <strong>${this.account?.city?.name}</strong>
                        </div>
                    </div>

                    <div class="col-md-3 border-right" style="">
                        <div class="contact-stat"><span>机构地址</span> <strong>${this.account?.address}</strong>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link  action="create"  id="${this.account.id}" class="btn btn-info btn-xs"><i class="fa fa-plus"></i>新增城市</g:link>
                </div>
                开通城市
            </div>

            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>城市名称</th>
                            <th>城市编码</th>
                            <th class="text-center" width="10%" colspan="2">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${accountCity}" var="r">
                            <tr>
                                <td>${r.city.name}</td>
                                <td>${r.city.zoneNumber}</td>
                                <td class="text-center">
                                    <g:form  action="deleteCity" style="display: inline-block" params="[accountId: r.account.id, cityId: r.city.id]" method="GET">
                                        <button class="deleteBtn btn btn-xs btn-danger btn-outline" type="button">
                                            <i class="fa fa-trash-o"></i>
                                            删除
                                        </button>
                                        <input type="hidden" name="accountId" value="${r.account.id}">
                                        <input type="hidden" name="cityId" value="${r.city.id}">
                                    </g:form>
                                </td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
            </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate total="${accountCity.size() ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>



